import Vue from "vue";
import Router from "vue-router";

import Movie from "../components/movie/Movie";
import MovieList from "../components/movie/MovieList";
import MovieDetail from "../components/movie/MovieDetail";
import MovieDetail2 from "../components/movie/MovieDetail2";

import Music from "@/components/music/Music.vue";
import MusicAlbums from '@/components/music/MusicAlbums'
import MusicList from '@/components/music/MusicList'
import Book from "@/components/book/Book.vue";
import BookList from '@/components/book/BookList'
import BookDetail from '@/components/book/BookDetail'
import Picture from "@/components/picture/Picture.vue";
import PictureList from "@/components/picture/PictureList.vue";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/movie/movieList"
    },
    {
      path: "/movie",
      name: "Movie",
      component: Movie,
      children: [
        {
          path: "movielist",
          component: MovieList,
          name: "MovieList"
        },
        {
          path: "moviedetail/:id",
          component: MovieDetail,
          name: "MovieDetail"
        },
        {
          path: "moviedetail2",
          component: MovieDetail2,
          name: "MovieDetail2"
        }
      ]
    },
    {
      path: "/music",
      component: Music,
      redirect:'/music/musicList',
      children:[
        {
          path:'musicList',
          component:MusicList
        },{
          path:'musicAlbums/:musicId',
          component:MusicAlbums
        }
      ]
    },
    {
      path: "/book",
      component: Book,
      redirect:'/book/bookList',
      children:[
        {
          path:'bookList',
          component:BookList
        },{
          path:'bookDetail',
          component:BookDetail
        }
      ]
    },
    {
      path: "/picture",
      component: Picture,
      redirect:'/picture/picturelist',
      children:[
        {
          path:'picturelist',
          component:PictureList
        }
      ]
    }
  ]
});
